home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
cuserid.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-26
|
466b
|
30 lines
/* ctermid() emulation by entropy@terminator.rs.itd.umich.edu
Public domain.
DO NOT USE THIS FUNCTION!
It is provided for System V compatibility only.
*/
#define _SYSV_SOURCE
#include <stdio.h>
#include <string.h>
#include <unistd.h>
char *
cuserid(s)
char *s;
{
static char name[L_cuserid];
char *t;
if (!s)
s = name;
t = getlogin();
if (t)
strncpy(s, t, L_cuserid);
else
s[0] = '\0';
s[L_cuserid - 1] = '\0';
return s;
}